/************************************************************************
Copyright 2003, 2004, 2005, 2006, 2007, 2008 Grid Technology Research Center,
National Institute of Advanced Industrial Science and Technology.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
************************************************************************/

package jp.aist.gtrc.plus.reserve;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.Calendar;


public interface ReserveServer extends Remote {

	String RMI_OBJECT_NAME = "ReserveServer";

	ReserveId reserve(ReserveRequest req) throws RemoteException, ReserveException;
	void commit(ReserveId rsvId) throws RemoteException, ReserveException;
	void abort(ReserveId rsvId) throws RemoteException, ReserveException;

	ReserveStatus getStatus(ReserveId rsvId) throws RemoteException, ReserveException;
	ReserveStatus[] getStatus(String owner, Calendar start,
			Calendar end, int nShowExpired) throws RemoteException, ReserveException;

	void cancel(ReserveId rsvId) throws RemoteException, ReserveException;
	void cancelOfOwner(String owner) throws RemoteException, ReserveException;

	void modify(ReserveId rsvId, ReserveRequest req) throws RemoteException, ReserveException;

	int availableNodeNum(Calendar start, Calendar end) throws RemoteException, ReserveException;

	void destroy(ReserveId rsvId) throws RemoteException, ReserveException;
	void destroyOfOwner(String owner) throws RemoteException, ReserveException;

	void stopServer() throws RemoteException, ReserveException;

}
